/**********************************************************
        设备管理头文件krldevice.h
***********************************************************
                彭东
**********************************************************/
#ifndef _KRLDEVICE_H
#define _KRLDEVICE_H
void      devtlst_t_init(devtlst_t* initp, uint_t dtype);
void      devtable_t_init(devtable_t* initp);
void      devid_t_init(devid_t* initp, uint_t mty, uint_t sty, uint_t nr);
void      device_t_init(device_t* initp);
void      krlretn_driverid(driver_t* dverp);
void      driver_t_init(driver_t* initp);
void      init_krldevice();
drvstus_t krlrun_driverentry(drventyexit_t drventry);
void      init_krldriver();
drvstus_t del_driver_dsc(driver_t* drvp);
driver_t* new_driver_dsc();
drvstus_t del_device_dsc(device_t* devp);
device_t* new_device_dsc();
drvstus_t drv_defalt_func(device_t* devp, void* iopack);
bool_t    krlcmp_devid(devid_t* sdidp, devid_t* cdidp);
drvstus_t krldriver_add_system(driver_t* drvp);
drvstus_t krldev_add_driver(device_t* devp, driver_t* drvp);
drvstus_t krlnew_device(device_t* devp);
drvstus_t krldev_inc_devcount(device_t* devp);
drvstus_t krldev_dec_devcount(device_t* devp);
drvstus_t krldev_add_request(device_t* devp, objnode_t* request);
drvstus_t krldev_complete_request(device_t* devp, objnode_t* request);
drvstus_t krldev_retn_request(device_t* devp, uint_t iocode, objnode_t** retreq);
drvstus_t krldev_wait_request(device_t* devp, objnode_t* request);
drvstus_t krldev_retn_rqueparm(void* request, buf_t* retbuf, uint_t* retcops, uint_t* retlen, uint_t* retioclde,
                               uint_t* retbufcops, size_t* retbufsz);
device_t* krlonidfl_retn_device(void* dfname, uint_t flgs);
drvstus_t krlnew_devhandle(device_t* devp, intflthandle_t handle, uint_t phyiline);
drvstus_t krldev_io(objnode_t* nodep);
drvstus_t krldev_call_driver(device_t* devp, uint_t iocode, uint_t val1, uint_t val2, void* p1, void* p2);
#endif  // KRLDEVICE_H
